using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SensorVisual
{
    public partial class Joystick : Form
    {
        private ControlSancho m_sancho;

        public Joystick(ControlSancho ai_sancho)
        {
            InitializeComponent();

            m_sancho = ai_sancho;
        }

        private void buttonParar_Click(object sender, EventArgs e)
        {
            m_sancho.SetSpeed(0, 0);
        }

        private void buttonAvanzar_Click(object sender, EventArgs e)
        {
            m_sancho.VelIzq += 10;
            m_sancho.VelDcha += 10;
        }

        private void buttonRetroceder_Click(object sender, EventArgs e)
        {
            m_sancho.VelIzq -= 10;
            m_sancho.VelDcha -= 10;
        }

        private void buttonIzquierda_Click(object sender, EventArgs e)
        {
            m_sancho.VelIzq -= 10;
            m_sancho.VelDcha += 10;
        }

        private void buttonDerecha_Click(object sender, EventArgs e)
        {
            m_sancho.VelIzq += 10;
            m_sancho.VelDcha -= 10;
        }
    }
}